<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:composition template="../comum/template.xhtml">

	<ui:define name="conteudo">

		<p:panel header="Questionario" style="width:50%; ">
			<h:panelGrid columns="2">
				<c:forEach var="pergunta"
					items="#{cadQuestionario.questionario.perguntas}" varStatus="i">
					<p:outputLabel for="pergunta#{i.count}"
						value="#{pergunta.pergunta}" style="font-weight:bold" />
					<p:selectOneRadio id="pergunta#{i.count}"
						value="#{pergunta.respondido.idResposta}">
						<c:forEach var="resposta" items="#{pergunta.alternativas}" varStatus="j">
							<f:selectItem itemLabel="#{resposta.resposta}"
								itemValue="#{resposta.idResposta}" id="opcao#{i.count}#{j.count}"/>
						</c:forEach>
					</p:selectOneRadio>
				</c:forEach>

			</h:panelGrid>
			<h:commandButton value="Enviar" id="btnLogin"
				actionListener="#{cadQuestionario.cadastrar}" />
			<h:message for="btnLogin" style="color:red" />
			<h:outputText value="" style="color: red" />

		</p:panel>
	</ui:define>

</ui:composition>
</html>